<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/base.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/css-wap/style.css">
    <script src="__STATIC__/js/jquery-1.8.2.js"></script>
    <title>分类</title>
</head>
<body style="background: #F6F6F6">
<div class="wrap-type">
    <div class="header">
        <p>分类</p>
        <img src="__STATIC__/img_user/back.png" class="back" hidden onclick=window.location.href=sessionStorage.getItem('goods_shai_url')>
        <img src="__STATIC__/img_user/find.png" class="set1"
             onclick=window.location.href="{:url('mobile/user_category/search')}">
    </div>
    <div class="tab">
        <!--左侧分类列表开始-->
        <div class="tablist">
            <ul>
                <li {eq name=":input('cate_id')" value="recommend" } class="cur" {/eq} >
                <a href="{:url('mobile/user_category/index')}?cate_id=recommend" style="display: block;">推荐分类</a></li>
                {volist name='left_arr' id='v'}
                <li {if condition="input('cate_id') eq $v.id" } class="cur" {/if}>
                <a href="{:url('mobile/user_category/index')}?cate_id={$v.id}" style="display: block;">{$v.title}</a></li>
                {/volist}
            </ul>
        </div>
        <!--左侧分类列表结束-->
        <div class="tabcon">
            <div class="cur">
                <!--顶部广告-->
                <!--
                <div class="main">
                    <a href="{$ad_find.linkUrl}">
                        <img {if condition="input('cate_id') eq 'recommend'" }
                             src="/{$ad_find.picUrl} {else/} src="/{$ad_find.ad_img} {/if}"
                            onerror=this.src="/static/mobile/img/empty_img.png"
                        >
                    </a>
                </div>-->
                <!--推荐分类-->
                {eq name=":input('cate_id')" value='recommend'}
                <div class="category">
                    <div style="padding-top: 2%;"><p><span class="note"> 为你推荐 </span></p></div>
                    <ul>
                        {volist name='data_details' id='v'}
                        <li><a href="javascript:;jump_search_goods({$v.id})">
                            <img src="/{$v.picUrl}" style="height: 75px;" onerror=this.src="/static/mobile/img/empty_img.png"><span>{$v.title}</span></a>
                        </li>
                        {/volist}
                    </ul>
                </div>
                {else/}
                <!--判断对象是否含有classify属性-->
                {if condition="isset($data_details.classify)"}

                {volist name='data_details.classify' id='v'}
                <div class="category">
                    <div style="padding-top: 2%;"><p><span class="note"> {$v.title} </span></p>
                    </div>
                    <ul>
                        {if condition="isset($v.classify)"}
                        {volist name='v.classify' id='vv'}
                        <li><a
                                href="javascript:jump_search_goods({$vv.id});"><img
                                src="/{$vv.picUrl}" onerror=this.src="/static/mobile/img/empty_img.png"
                                style="width: 65px;height: 65px;"><span style="white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">{$vv.title}</span></a></li>
                        {/volist}
                        {/if}
                    </ul>
                </div>
                {/volist}
                {else/}
                <p style="text-align: center;color: #7B7B7B;margin-top: 5%">- 无子分类 -</p>
                {/if}
                {/eq}
            </div>

        </div>

    </div>

    <div class="footer-menu">
        <ul class="footer_menu_list">
            <li><a href="{:url('mobile/user_port/index')}"><img src="__STATIC__/img-wap/nav5.png"><span>首页</span></a></li>
            <li class="active"><a href="{:url('mobile/user_category/index')}?cate_id=recommend"><img src="__STATIC__/img-wap/nav6.png"><span>分类</span></a></li>
            <li><a href="javascript:cart_check();"><img src="__STATIC__/img-wap/nav3.png"><span>购物车</span></a></li>
            <li><a href="{:url('mobile/user_info/my_shop_index')}"><img src="__STATIC__/img-wap/nav4.png"><span>我的</span></a></li>
        </ul>
    </div>
</div>
<script src="__STATIC__/js/layer_mobile/layer.js"></script>
<script>
    $(function () {
        if (sessionStorage.getItem('goods_shai_url')){
            $('.back').css('display','block');
        }
    });
    //未登录跳转到登录
    function jump_login(){
        window.location.href="{:url('mobile/user_port/login')}";
    }
    function cart_check(){
        if ('{$Think.session.member_id}'){
            window.location.href="{:url('mobile/user_cart/cart_index')}";
        }else{
            jump_login();
        }
    }
    //跳转商品列表
    function jump_search_goods(id){
        var pass_url = sessionStorage.getItem('goods_shai_url');
        var create_url = pass_url+"&cate_id="+id;
        if (!pass_url){
            var url = "{:url('mobile/UserCategory/search_goods')}?cate_id="+id;
            sessionStorage.setItem('search_back_url',window.location.href);
            window.location.href = url;
        }else{
            if (pass_url.indexOf('?') < 0){
                create_url = pass_url+"?cate_id="+id;
            }
            window.location.href = create_url;
        }

    }
</script>
</body>
</html>